package com.semidata.trp.report.report;

import java.math.BigDecimal;

public class ReportUnit {
	private long pv;
	private long click;
	private BigDecimal cost;

	public ReportUnit() {
		pv = 0;
		click = 0;
		cost = BigDecimal.valueOf(0);
	}

	public ReportUnit(long pv, long click, double cost) {
		this.pv = pv;
		this.click = click;
		this.cost = BigDecimal.valueOf(cost);
	}

	public long getPv() {
		return pv;
	}

	public void setPv(long pv) {
		this.pv = pv;
	}

	public void addPv(long value) {
		this.pv = pv + value;
	}

	public long getClick() {
		return click;
	}

	public void setClick(long click) {
		this.click = click;
	}

	public void addClick(long value) {
		this.click = click + value;
	}

	public double getCost() {
		return cost.doubleValue();
	}

	public void setCost(double cost) {
		this.cost = BigDecimal.valueOf(cost);
		;
	}

	public void addCost(double value) {
		this.cost = cost.add(BigDecimal.valueOf(value));
	}

	public void merge(ReportUnit totalReport) {
		// TODO Auto-generated method stub
		addPv(totalReport.getPv());
		addClick(totalReport.getClick());
		addCost(totalReport.getCost());
	}

	public void clear() {
		// TODO Auto-generated method stub
		pv = 0;
		click = 0;
		cost = BigDecimal.valueOf(0);
	}
}
